<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>Sample2 - simple-template</title>
<script type="text/javascript" src="../../simple-template.js"></script>
</head>
<body>
<div id="template-id">
$#
var val = 0;
for(var i = 1; i &lt; 10; i++){
	val += i;
}
val;
 # //45<br>
$# server.host@default:function(){
	var out = "";
	for(var i = 0; i &lt; 5; i++){
		out += server.address;
	}
	return out;
}()
 #
</div>
<script type="text/javascript">
	var html = new SimpleTemplate().parse("template-id", {server:{address:"addr"}});
	document.getElementById("template-id").innerHTML = html;
</script>
</body>
</html>